function openLeft_dh() {
	var nmsb = document.body.scrollHeight;
	document.getElementById("left_dh").style.height="nmsb-50";
	document.getElementById("left_dh").style.left="0";
	document.getElementById("left_dh").style.transaction="0.3s";
	document.getElementById("black_bg").style.display="block";
	var a = document.getElementById("menubt");
	a.onclick = closeLeft_dh;
	var element = document.getElementById('imgmenu');
	element.src = "./WebView/Static/Img/menuo.png";
}

function closeLeft_dh() {
	document.getElementById("left_dh").style.left="-180";
	document.getElementById("left_dh").style.transaction="0.3s";
	document.getElementById("black_bg").style.display="none";
	var a = document.getElementById("menubt");
	a.onclick = openLeft_dh;
	var element = document.getElementById('imgmenu');
	element.src = "./WebView/Static/Img/menu.png";
}

//查找按钮被点击
function searchbut(){
	if(/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)) {
		var searchvas = document.getElementById("search").value.replace(/\s+/g,"");
		if(searchvas != "" & searchvas != null){
			window.location.href="/videos?search="+searchvas;
		}else{
			document.getElementById("search").style.display="block";
			document.getElementById("search").style.float="left";
			document.getElementById("search").style.width="95%";
			document.getElementById("search").style.margin="0";
			document.getElementById("search").style.marginLeft="10";
			document.getElementById("search").style.marginTop="5";
			document.getElementById("black_bg2").style.display="block";
		}
	}else {
	var searchva = document.getElementById("search").value.replace(/\s+/g,"");
	if(searchva != "" & searchva != null){
		window.location.href="/videos?search="+searchva;
	}
	}
}

if(/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)) {
	document.getElementById("search").style.display = "none";
}

function close_Seach(){
	document.getElementById("search").style.display = "none";
	document.getElementById("black_bg2").style.display="none";
}

// 当网页向下滑动 30px 出现"返回顶部" 按钮
window.onscroll = function() {
	scrollFunction();
};
function scrollFunction() {
	if (document.body.scrollTop > 30 || document.documentElement.scrollTop > 20) {
		document.getElementById("btnTop").style.display = "block";
	} else {
		document.getElementById("btnTop").style.display = "none";
	}
} 
// 点击按钮，返回顶部
function returnTop() {
	document.body.scrollTop = 0;
	document.documentElement.scrollTop = 0;
}

function addcookie() {
	var scrolltopin = document.body.scrollTop;
	var postline = "is=1&line="+scrolltopin;
	$.post("operation/postlinecookie.php",postline);
}
function returnline() {
	closeLeft_dh()
	var postline = "is=0&line=?";
	$.post("operation/postlinecookie.php",postline,function(res){
		document.body.scrollTop = res;
	})
}